﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestPlatform.Performer.Mssql.EF.Entities;
using TestPlatform.Core;

namespace TestPlatform.Performer.Mssql.EF
{
    public class MssqlEFDeletePerformer : BaseDeletePerformer
    {
        public override string UnderlyinEngine { get { return "MSSQL - EF"; } }

        public MssqlEFDeletePerformer()
            : base(new MssqlHelper())
        {

        }

        protected override void RemoveEntity(Guid id)
        {
            using (var c = new RepositoryContext())
            {
                c.Users.Remove(c.Users.SingleOrDefault(u => u.Id == id));
                c.SaveChanges();
            }
        }
    }
}
